#define MAX_BATCH_SIZE 1024
-#define DEBUG 0
+#define DEBUG 1
#if DEBUG
#define DPRINTF(_f, _a...) printf ( _f , ## _a )
goto out;
}
- switch( region_pfn_type[i] )
+ switch( region_pfn_type[i] & LTABTYPE_MASK )
{
case 0:
break;
*/
for ( i = 0; i < nr_pfns; i++ )
{
- if ( pfn_type[i] == L1TAB )
+ if ( pfn_type[i] == (L1TAB|LPINTAB) )
{
+printf("XXXXXXXXXXXXXXX pin L1\n");
if ( add_mmu_update(xc_handle, mmu,
(pfn_to_mfn_table[i]<<PAGE_SHIFT) |
MMU_EXTENDED_COMMAND,
goto out;
}
}
- else if ( pfn_type[i] == L2TAB )
+ else if ( pfn_type[i] == (L2TAB|LPINTAB) )
{
+printf("XXXXXXXXXXXXXXX pin L2\n");
if ( add_mmu_update(xc_handle, mmu,
(pfn_to_mfn_table[i]<<PAGE_SHIFT) |
MMU_EXTENDED_COMMAND,
/* Uncanonicalise the page table base pointer. */
pfn = ctxt.pt_base >> PAGE_SHIFT;
- if ( (pfn >= nr_pfns) || (pfn_type[pfn] != L2TAB) )
+ if ( (pfn >= nr_pfns) || ((pfn_type[pfn]<ABTYPE_MASK) != L2TAB) )
{
printf("PT base is bad. pfn=%lu nr=%lu type=%08lx %08lx\n",
pfn, nr_pfns, pfn_type[pfn], (unsigned long)L2TAB);
#define BATCH_SIZE 1024 /* 1024 pages (4MB) at a time */
#define DEBUG 1
-#define DDEBUG 0
+#define DDEBUG 1
#if DEBUG
#define DPRINTF(_f, _a...) printf ( _f , ## _a )
set_bit( n, to_fix );
if( iter>1 )
- DDPRINTF("netbuf race: iter %d, pfn %lx. mfn %lx\n",
+ DDPRINTF("netbuf race: iter %d, pfn %x. mfn %lx\n",
iter,n,pfn_type[batch]);
continue;
}
batch++;
}
- DDPRINTF("batch %d:%d (n=%d)\n", iter, batch, n);
+// DDPRINTF("batch %d:%d (n=%d)\n", iter, batch, n);
if ( batch == 0 )
goto skip; /* vanishingly unlikely... */
continue;
}
- if ( ((pfn_type[j] & LTAB_MASK) == L1TAB) ||
- ((pfn_type[j] & LTAB_MASK) == L2TAB) ){
+ if ( ((pfn_type[j] & LTABTYPE_MASK) == L1TAB) ||
+ ((pfn_type[j] & LTABTYPE_MASK) == L2TAB) ){
memcpy(page, region_base + (PAGE_SIZE*j), PAGE_SIZE);
for ( k = 0;
- k < (((pfn_type[j] & LTAB_MASK) == L2TAB) ?
+ k < (((pfn_type[j] & LTABTYPE_MASK) == L2TAB) ?
(HYPERVISOR_VIRT_START >> L2_PAGETABLE_SHIFT) :
1024);
k++ ){
/* Canonicalise each GDT frame number. */
for ( i = 0; i < ctxt.gdt_ents; i += 512 ) {
- ctxt.gdt_frames[i], live_mfn_to_pfn_table[ctxt.gdt_frames[i]]);
if ( !translate_mfn_to_pfn(&ctxt.gdt_frames[i]) ) {
xcio_error(ioctxt, "GDT frame is not in range of pseudophys map");
goto out;
if ( likely(get_page(page, d)) )
{
unsigned long type = 0;
+
switch( page->u.inuse.type_info & PGT_type_mask )
{
case PGT_l1_page_table:
type = L4TAB;
break;
}
- l_arr[j] |= type;
+
+ if ( page->u.inuse.count_info & PGC_guest_pinned )
+ type |= LPINTAB;
+ l_arr[j] |= type;
put_page(page);
}
else
#define L2TAB (2<<28)
#define L3TAB (3<<28)
#define L4TAB (4<<28)
+#define LPINTAB (1<<31)
#define XTAB (0xf<<28) /* invalid page */
#define LTAB_MASK XTAB
+#define LTABTYPE_MASK (0x7<<28)
+
typedef struct {
/* IN variables. */
memory_t pfn; /* 0: Machine page frame number to query. */